package org.dromara.system.cloud;


import cn.hutool.core.date.DateUtil;
import lombok.Data;
import org.dromara.system.domain.SysTenant;

@Data
public class MiniTenant extends MiniBase{


    private String address;

    private String company_name;

    private String contact_phone;

    private String contact_user_name;

    private String expire_time;

    private String intro;

    private String remark;

    private String tenant_id;


    public static MiniTenant build(SysTenant sysTenant) {
        MiniTenant miniTenant = new MiniTenant();

        String id = sysTenant.getTenantId();

        miniTenant.setTenant_id(id);
        miniTenant.set_id(id);
        miniTenant.setAddress(sysTenant.getAddress());
        miniTenant.setIntro(sysTenant.getIntro());
        miniTenant.setCompany_name(sysTenant.getCompanyName());
        miniTenant.setContact_phone(sysTenant.getContactPhone());
        miniTenant.setRemark(sysTenant.getRemark());
        miniTenant.setContact_user_name(sysTenant.getContactUserName());
        miniTenant.setExpire_time(DateUtil.format(sysTenant.getExpireTime(), "yyyy-MM-dd HH:mm:ss"));
        return miniTenant;
    }
}

